#ifndef WIDGET_AI_STATISTICS_H
#define WIDGET_AI_STATISTICS_H



#include "graph.h"
#include "gui.h"



/** @brief Class for showing speed of algorithm of one player
*
*   \image html widget_ai_statistics.jpeg
*/
class time_graph_widget: public Plot
{
	
public:

	/** @brief Creates graph
	*	@param data time periods to draw, constraint: data != 0
	*	@param title graph title
	*	@param scale value to get same scale as other graphs in windows
	*	@param size number of entries
	*	@param pl_id id of players, to whom the graph belongs
	*	@param mean mean of all values in graph (to display)
	*	@param parent Qt parent
	*/
	time_graph_widget( vector< double >* data, const string& title, double scale, int size, unsigned int pl_id, double mean, QWidget* parent );
	//! @brief Deletes graph curve
	~time_graph_widget();


private:

	//! graph curves array
	QwtPlotCurve* ai_time;
	//! mean of times
	QwtPlotMarker* meanY;

};



/** @brief Class for comaring speed of all ai algorithms.
*
*	Each player will have one graph in the window.
*
*   \image html widget_ai_statistics.jpeg
*/
class ai_statistics_widget: public QWidget
{

public:

	/** @brief Creates widget with graphs
	*	@param parent Qt parent of the widget
	*	@param flags Qt flags
	*/
	ai_statistics_widget( QWidget* parent = 0, Qt::WFlags flags = 0 );


private:

	/** @brief	Gets max value from vector
	*	@param	data vector where to find for value
	*	@return	max value
	*/
	double get_max( vector< double >* data );

	/** @brief	Gets max mean from vector
	*	@param	data vector where to compute mean
	*	@return	mean value
	*/
	double get_mean( vector< double >* data );

};



#endif